#include "settingswindow.h"
#include "ui_settingswindow.h"

SettingsWindow::SettingsWindow(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::SettingsWindow)
{
    ui->setupUi(this);

}

SettingsWindow::~SettingsWindow()
{
    delete ui;
}

void SettingsWindow::LoadSettings()
{
    ui->lineEdit -> setText(settings.value("UserName", "").toString());
    ui->lineEdit_2 -> setText(settings.value("UserPassword", "").toString());
}

void SettingsWindow::on_pushButton_clicked()
{
    if(ui->lineEdit->text().length()==0||ui->lineEdit_2->text().length()==0)
    {
        MessageBox.information(NULL,QString(""),QString("User name or password is incorrect!"),QMessageBox::Ok,QMessageBox::NoButton);

    }
    else
    {
//        settings.setPath(QSettings::IniFormat,QSettings::UserScope,"ShotScreensUploader.ini");
//        settings.setValue("UserName",ui->lineEdit->text().toAscii().data());
//        settings.setValue("UserPassword",ui->lineEdit_2->text().toAscii().data());
        this->parentWidget()->close();

    }
}
